package com.hh.feign;

import com.hh.entity.Basket;
import com.hh.feign.hystrix.OrderCartFeignHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author 辉辉 2022/8/22 12:23
 */
@FeignClient(value = "cart-service", fallback = OrderCartFeignHystrix.class)
public interface OrderCartFeign {
    /**
     * 远程调用购物车 拿到购物车的商品集合
     *
     * @param basketIds
     * @return
     */
    @PostMapping("/getBasketByIds")
    List<Basket> getBasketByIds(@RequestParam List<Long> basketIds);

    /**
     * 远程调用根据用户id和skuIds清空购物车清空购物车
     *
     * @param openId
     * @param skuIds
     */
    @PostMapping("/clearCart")
    void clearCart(@RequestParam("openId") String openId, @RequestParam("skuIds") List<Long> skuIds);

}
